package viewCollection;

import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Vector;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JMenu;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

public class AptitudesView {
  private JPanel main_panel_;
  JTable concentrations_table_;
  JTable character_table_;

  public AptitudesView(JPanel main_panel) {
    main_panel_ = main_panel;
  }
  
  public void paintApts() {
    System.out.println("clicked");
    main_panel_.removeAll();
    main_panel_.setLayout(new BorderLayout());
    Vector<String> vec = new Vector<String>();
    vec.add("Zeug1");
    vec.add("Zeug2");

    Vector<String> vec2 = new Vector<String>();
    vec2.add("foo");
    vec2.add("bar");
    DefaultTableModel model = new DefaultTableModel(vec, 0);
    model.addRow(vec2);
    concentrations_table_ = new JTable(model);
    character_table_ = new JTable(model);
    JComboBox<String> combo_box_ = new JComboBox<String>(vec2); 
    
    /*button.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent arg0) {
        Vector<String> vec3 = new Vector<String>();
        vec3.add("a");
        vec3.add("r");
        ((DefaultTableModel)concentrations_table_.getModel()).addRow(vec3);
      }
    });*/
    //add(new JScrollPane(table_), BorderLayout.NORTH);
    main_panel_.add(combo_box_, BorderLayout.NORTH);
    main_panel_.add(concentrations_table_, BorderLayout.WEST);
    main_panel_.add(character_table_, BorderLayout.EAST);
    main_panel_.repaint();
    main_panel_.revalidate();
    main_panel_.doLayout();
  }
}
